package sgg.juc.ticket;

public class TicketManager {

    private static int ticketNum = 30;

    public static synchronized int sellTicket() {
        if (ticketNum == 0) {
            return 0;
        }
        return ticketNum--;
    }

}
